home *** CD-ROM | disk | FTP | other *** search
- *****Listing 1*****
-
-
- /* These are determined from the debug information */
- #define AND_INSTRUCTION_OFFSET 0x10
- #define OR_INSTRUCTION_OFFSET 0x15
- set_plot_type(type)
- {
- unsigned char *pc;
- void draw_function();
-
- /* The function you want to modify */
-
-
- pc = (void *) draw_function;
-
- switch(type)
- {
- case XOR:
- /* Put NOPS for the masking operation */
- *(pc + AND_INSTRUCTION OFFSET) = 0x90; /* NOP */
- *(pc + AND_INSTRUCITON OFFSET + 1) = 0X90;
- *(pc + OR_INSTRUCTION_OFFSET) = 0x03; /* XOR */
- break;
- case OVERWRITE:
- *(pc + AND_INSTRUCTION_OFFSET) = 0x02; /* AND */
- *(pc + AND_INSTRUCITON_OFFSET + 1) = 0x00
- /* Register */
-
- *(pc + OR_INSTRUCTION_OFFSET) = 0x08; /* OR */
- break;
- }
- return;
- {
-
-
- *********
-